// JavaScript Document
function func_swapimg(swapname){
$.ajax({
type: "GET",
url: "../TCB/xml/swimage.xml",
dataType: "xml",
success: function(xml) {
var ispeed = 3000;
//var ctswap = '
'
var ctswap = '';
var iPosition = 0;
$(xml).find('swapimg').each(function(){
var id = $(this).attr('id');
if(id == swapname){
var img_width = $(this).find('width').text();
var tmp = "";
ispeedtmp = $(this).find('time').text();
$(this).find('src').each(function(){
var imgsrc = $(this).text();
var ilink = $(this).attr('link');
//tmp += "
";
tmp += "
";
});
ctswap +=tmp;
}
});
ctswap +='';
if(document.getElementById(swapname)!=null){
document.getElementById(swapname).innerHTML = ctswap;
ispeed = ispeedtmp;
$('#'+swapname+' a:gt(0)').hide()
setInterval(function(){
$('#'+swapname+' a:first-child').fadeOut("slow")
.next('a').fadeTo('slow',1)
.end().appendTo('#'+swapname+'');},
parseInt(ispeed));
}
}
});
}
function func_swapctn(swapname){
$.ajax({
type: "GET",
url: "../modelbank/unprotected/swapctns.xml",
dataType: "xml",
success: function(xml) {
var ispeed = 3000;
var nAuto = 500;
var nSpeed = 1200;
var nVertical = true;
var ctswap = '';
var tmp = "";
ctswap += 'TIN TỨC
';
ctswap += ' ';
ctswap += '
';
$(xml).find('swapctn').each(function(){
var id = $(this).attr('id');
if(id == swapname){
nAuto = $(this).find('auto').text();
nSpeed = $(this).find('speed').text();
nVertical = $(this).find('vertical').text();
$(this).find('content').each(function(){
tmp += '- ';
var ncontent = $(this).text();
var ilink = $(this).attr('link');
tmp += ""+ncontent+"";
tmp += '
';
});
ctswap +=tmp+"
";
ctswap +="
";
}
});
ctswap +='';
if(document.getElementById("ct_news")!=null){
document.getElementById("ct_news").innerHTML = ctswap;
$(".vnews").jCarouselLite({
auto: parseInt(nAuto),
speed: parseInt(nSpeed),
vertical:true
});
}
}
});
}
function func_swapctn_en(swapname){
$.ajax({
type: "GET",
url: "../modelbank/unprotected/swapctns_en.xml",
dataType: "xml",
success: function(xml) {
var ispeed = 3000;
var nAuto = 500;
var nSpeed = 1200;
var nVertical = true;
var ctswap = '';
var tmp = "";
ctswap += 'NEWS
';
ctswap += ' ';
ctswap += '
';
$(xml).find('swapctn').each(function(){
var id = $(this).attr('id');
if(id == swapname){
nAuto = $(this).find('auto').text();
nSpeed = $(this).find('speed').text();
nVertical = $(this).find('vertical').text();
$(this).find('content').each(function(){
tmp += '- ';
var ncontent = $(this).text();
var ilink = $(this).attr('link');
tmp += ""+ncontent+"";
tmp += '
';
});
ctswap +=tmp+"
";
ctswap +="
";
}
});
ctswap +='';
if(document.getElementById("ct_news")!=null){
document.getElementById("ct_news").innerHTML = ctswap;
$(".vnews").jCarouselLite({
auto: parseInt(nAuto),
speed: parseInt(nSpeed),
vertical:true
});
}
}
});
}
function isIECompatible(iLangver){
var code = "";
var browserVersion = $.browser.version.slice(0,$.browser.version.indexOf("."));
var documentVersion = document.documentMode;
if(browserVersion < 8 && documentVersion < 8){
if (iLangver>1)
code = 'Phiên bản Internet Explore của bạn không được hỗ trợ.
Nhấn vào đây để xem hướng dẫn.';
else
code = "Internet Explore version is not supported.
Click here for guiding.";
}
else if(documentVersion < 8) {
if (iLangver>1)
code = 'Chế độ hiển thị không đúng.
Nhấn vào đây để xem hướng dẫn.';
else
code = "Internet Explore version is not supported.
Click here for guiding.";
}
//code = "nhấn vào đây để xem hướng dẫn";
//alert(code);
return code;
}